package chapter9;
import java.io.*;
import java.net.InetAddress;
import java.net.Socket;;
public class ClientTest
{
        public static void main(String[] args) throws IOException
        {
                   InetAddress addr = InetAddress.getByName("192.168.1.35");
                   System.out.println("addr ="+addr);
                   Socket socket = new Socket(addr,ServerTest.PORT);
                   try
                   {
                               System.out.println("socket="+socket);
                               BufferedReader in = new BufferedReader(new InputStreamReader(socket.getInputStream()));
                               PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(socket.getOutputStream())),true);
                               for(int i =0;i<0;i++)
                               {
                                           out.println("howdy"+i);
                                           String str = in.readLine();
                                           System.out.println(str);
                               }
                               out.println("END");
                   }
                   finally
                   {
                               System.out.println("closing...");
                               socket.close();
                   }
        }
}